//Using SDL and standard IO 
#include "SDL2/SDL.h"
//#include <SDL2/SDL_image.h>
#include <stdio.h> 
// 屏幕尺寸常数`在这里插入代码片`
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
int main( int argc, char* args[] ){
    // 我们要渲染的窗口
    SDL_Window* window = NULL;
    
    // 窗口所包含的表面
    SDL_Surface* screenSurface = NULL;

    // 初始化SDL
    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ){
        printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
    }else{
        // 创建窗口
        window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
        if( window == NULL ){
            printf( "Window could not be created! SDL_Error: %s\n", SDL_GetError() );
        }else{
            // 获取窗口表面
            screenSurface = SDL_GetWindowSurface( window );

            // 用白色填充表面
            SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF ) );
            
            // 更新表面
            SDL_UpdateWindowSurface( window );

            // 等待2秒
            SDL_Delay( 2000 );
        }
    }

 // 销毁窗户
 SDL_DestroyWindow( window );
 // 退出SDL子系统   
 SDL_Quit();
 return 0;
}
